package com.company;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * @author Administrator
 */
public class HJ15求int型正整数在内存中存储时1的个数 {
    public static void main(String[] args) {
        List<Integer> integerList = new ArrayList<>();
        Scanner scanner = new Scanner(System.in);
        int input = scanner.nextInt();
        String binaryString = Integer.toBinaryString(input);
        for (int i = 0; i < binaryString.length(); i++) {
            integerList.add(Integer.parseInt(binaryString.substring(i, i + 1)));
        }
        Map<Integer, Long> map =
                        integerList.stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
        map.forEach((k, v) -> {
            if (k == 1) {
                System.out.println(v);
            }

        });
    }
}
